﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EntityDataModel;
using System.Runtime.Serialization;

namespace LiveCPEWebService.Entity
{
    [DataContractAttribute]
    public class MessageWS
    {
        [DataMember]
        public Guid MessageID
        {
            get
            {
                return _messageID;
            }
            set
            {
                _messageID = value;
            }
        }
        private Guid _messageID;
        [DataMember]
        public DateTime PublicationDate
        {
            get
            {
                return _publicationDate;
            }
            set
            {
                _publicationDate = value;
            }
        }
        private DateTime _publicationDate;
        [DataMember]
        public decimal NumLike
        {
            get
            {
                return _numLike;
            }
            set
            {
                _numLike = value;
            }
        }
        private decimal _numLike;
        [DataMember]
        public String SenderName
        {
            get
            {
                return _senderName;
            }
            set
            {
                _senderName = value;
            }
        }
        private String _senderName;
        [DataMember]
        public String ReceiverName
        {
            get
            {
                return _receiverName;
            }
            set
            {
                _receiverName = value;
            }
        }
        private String _receiverName;
        [DataMember]
        public String MessageContent
        {
            get
            {
                return _messageContent;
            }
            set
            {
                _messageContent = value;
            }
        }
        private String _messageContent;
        [DataMember]
        public Boolean IsPrivate
        {
            get
            {
                return _isPrivate;
            }
            set
            {
                _isPrivate = value;
            }
        }
        private Boolean _isPrivate;
        [DataMember]
        public Boolean IsVisible
        {
            get
            {
                return _isVisible;
            }
            set
            {
                _isVisible = value;
            }
        }
        private Boolean _isVisible;
        [DataMember]
        public DateTime DeletionDate
        {
            get
            {
                return _deletionDate;
            }
            set
            {
                _deletionDate = value;
            }
        }
        [DataMember]
        public String PublicationAge;
        private DateTime _deletionDate;

        public MessageWS() { }

        public void Generate(Message pMessage)
        {
            PublicationDate = pMessage.PublicationDate.Value;
            NumLike = pMessage.NumLike.Value;
            SenderName = pMessage.SenderName;
            ReceiverName = pMessage.ReceiverName;
            MessageContent = pMessage.MessageContent;
            MessageID = pMessage.MessageID;
            PublicationAge = pMessage.PublicationAge;
        }

    }
}